home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp95
/
chmodc.exe
/
lha
/
CHMOD.DOC
next >
Wrap
Text File
|
1987-12-28
|
6KB
|
150 lines
/*
* CHMOD -- A PC/MS-DOS File-Attribute Modification Program
*
* Copyright (c) Moderne Software 1987. All rights reserved.
*
* Introduction
* ------------
* The CHMOD program is a utility program that replaces the DOS ATTRIB program.
* CHMOD does everything ATTRIB will do...and more. It will allow you to view
* the current attribute settings for ANY file. It will also allow you to set
* ANY of the available attributes (including the Hidden and System attributes)
* on any file, including directory files.
*
* Command Line
* ------------
* CHMOD
* CHMOD filespec [-options...] [filespec [-options...]...]
* CHMOD -V
*
* Where:
* filespec is a file specification with optional drive and path.
* Wildcards are supported. Backslash(\) and/or slash(/)
* characters may be used as path separators.
* options are one or more of the supported option specifications.
* -V is a request to display the program version number.
*
* Command line file and option specifications may be entered in upper
* or lower case.
*
* Options
* -------
* Options are specified after the file spec to which they refer. Options
* are preceded by a dash (-) character. Multiple options may be specified
* provided there are no spaces following each option. For example,
* "-a -s -h" and "-ash" are identical; "-a s h" is invalid as an option
* specification.
*
* Each option refers to a specific attribute associated with a certain
* file. For example, the -A option refers to the Archive attribute.
* Attributes may be set or unset.
*
* To set an attribute, a plus sign (+) must follow the attribute
* specification, as in -A+.
*
* To unset (or clear) an attribute, a minus sign (-) or any character
* except a plus sign (+) must follow the attribute spec. All of the
* following option specs clear the Archive attribute: -A -A- -AH.
*
* Attributes
* ----------
* -A specifies the Archive attribute.
*
* -H specifies the Hidden attribute.
*
* -R specifies the Read-Only attribute.
*
* -S specifies the System attribute.
*
* Setting Attributes of Directories
* ---------------------------------
* Attributes are intended to be used for normal files, but they can also
* be set on directory files. Directory files with the Archive, Hidden,
* Read-Only, or System attributes set behave a little differently than
* normal files with the same attributes.
*
* Archive : Unknown, may affect BACKUP. This attribute
* is not set when a directory is created as it
* is when a normal file is first created or
* modified.
*
* Read-Only : No known effect. Directory can still be
* RMDIR'ed.
*
* Hidden : DIR will not display directory; can still be
* CHDIR'ed and RMDIR'ed.
*
* System : Same effects as Hidden attribute.
*
* To set the attributes of a directory file, include the special option
* -D in the option specification. For example:
*
* CHMOD PASSWORD -DH+
*
* will set the Hidden attribute for the PASSWORD directory. If you do
* not include the -D option spec, the Hidden attribute will not be set.
*
* As another example:
*
* CHMOD *.* -H+
*
* will set the Hidden attribute on all files EXCEPT directory files. To
* set the Hidden attribute on all files, including directories, enter:
*
* CHMOD *.* -DH+
*
* Program Output
* --------------
* If no file specs are specified, a usage screen will be displayed.
* If no options are specified, the current attributes of the specified
* files are output. Output format for each file spec is:
*
* drash <filespec>
*
* where the existence of the:
* 'd' : specifies the file is a Directory.
* 'r' : specifies the Read-Only attribute is set for the file.
* 'a' : specifies the Archive attribute is set for the file.
* 's' : specifies the System attribute is set for the file.
* 'h' : specifies the Hidden attribute is set for the file.
*
* If the associated attribute is not set, the space will contain a
* dash character. For example:
*
* -ra-- copy.com
*
* indicates the file "copy.com" is not a subdirectory, is read-only,
* has the archive bit set, and is not hidden nor is it a system file.
*
* If options are specified, the specified attributes are set or cleared
* and the new attribute settings are displayed for each specified file.
*
* Given the above situation with the copy.com file, the following
* command line will generate this output:
*
* CHMOD COPY.COM -H+
*
* -ra-h copy.com
*
* History
* -------
* 28Dec87 Version 2.02
* Pretty-print some of the source, adding comments.
* Replace extern function prototypes of standard C library
* functions with appropriate #include directives.
* Slight addition to usage screen.
* 10Oct87 Version 2.01
* Construct file attribute with which to find wildcard matches
* in this file, rather than have expand_wildcard_filespec()
* use a default attribute.
* 7Sep87 Version 2.00
* Complete rewrite of program.
* Support wildcard file specs.
* Reformat output.
* Sort output files.
* 28Feb87 Version 1.1
* Support directory attribute setting.
* 28Dec86 Version 1.0
* Created.
*/